'use strict';

const Service = require('egg').Service;
const { ObjectId } = require("mongodb")

class ArticleService extends Service {
    async find(id = null) {
        var db = this.app.mongodb;
        var res = await db.collection("article").find({ _id: ObjectId(id) }).toArray();
        return res;
    }
}

module.exports = ArticleService;
